<?xml version="1.0" encoding="ascii"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
          "DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>trunk.BIP.Bayes.PlotMeld</title>
  <link rel="stylesheet" href="epydoc.css" type="text/css" />
  <script type="text/javascript" src="epydoc.js"></script>
</head>

<body bgcolor="white" text="black" link="blue" vlink="#204080"
      alink="#204080">
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
       bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="middle">
  <!-- Home link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="trunk.BIP-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Tree link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Project homepage -->
      <th class="navbar" align="right" width="100%">
        <table border="0" cellpadding="0" cellspacing="0">
          <tr><th class="navbar" align="center"
            ><a class="navbar" target="_top" href="http://code.google.com/p/bayesian-inference">Project Homepage</a></th>
          </tr></table></th>
  </tr>
</table>
<table width="100%" cellpadding="0" cellspacing="0">
  <tr valign="top">
    <td width="100%">
      <span class="breadcrumbs">
        Package&nbsp;trunk ::
        <a href="trunk.BIP-module.html">Package&nbsp;BIP</a> ::
        <a href="trunk.BIP.Bayes-module.html">Package&nbsp;Bayes</a> ::
        Module&nbsp;PlotMeld
      </span>
    </td>
    <td>
      <table cellpadding="0" cellspacing="0">
        <!-- hide/show private -->
        <tr><td align="right"><span class="options">[<a href="javascript:void(0);" class="privatelink"
    onclick="toggle_private();">hide&nbsp;private</a>]</span></td></tr>
      </table>
    </td>
  </tr>
</table>
<!-- ==================== MODULE DESCRIPTION ==================== -->
<h1 class="epydoc">Module PlotMeld</h1><p class="nomargin-top"><span class="codelink"><a href="trunk.BIP.Bayes.PlotMeld-pysrc.html">source&nbsp;code</a></span></p>
Module with specialized plotting functions for the Melding results

<hr />
<div class="fields">      <p><strong>Date:</strong>
        $06/01/2010 11:24:20$
      </p>
      <p><strong>Author:</strong>
        fccoelho
      </p>
</div><!-- ==================== FUNCTIONS ==================== -->
<a name="section-Functions"></a>
<table class="summary" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td colspan="2" class="table-header">
    <table border="0" cellpadding="0" cellspacing="0" width="100%">
      <tr valign="top">
        <td align="left"><span class="table-header">Functions</span></td>
        <td align="right" valign="top"
         ><span class="options">[<a href="#section-Functions"
         class="privatelink" onclick="toggle_private();"
         >hide private</a>]</span></td>
      </tr>
    </table>
  </td>
</tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a name="plot_series"></a><span class="summary-sig-name">plot_series</span>(<span class="summary-sig-arg">tim</span>,
        <span class="summary-sig-arg">obs</span>,
        <span class="summary-sig-arg">series</span>,
        <span class="summary-sig-arg">names</span>=<span class="summary-sig-default">[]</span>,
        <span class="summary-sig-arg">title</span>=<span class="summary-sig-default">'series'</span>)</span></td>
          <td align="right" valign="top">
            <span class="codelink"><a href="trunk.BIP.Bayes.PlotMeld-pysrc.html#plot_series">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a name="plot_pred"></a><span class="summary-sig-name">plot_pred</span>(<span class="summary-sig-arg">tim</span>,
        <span class="summary-sig-arg">series</span>,
        <span class="summary-sig-arg">y</span>,
        <span class="summary-sig-arg">fig</span>,
        <span class="summary-sig-arg">names</span>=<span class="summary-sig-default">[]</span>,
        <span class="summary-sig-arg">title</span>=<span class="summary-sig-default">'series'</span>)</span></td>
          <td align="right" valign="top">
            <span class="codelink"><a href="trunk.BIP.Bayes.PlotMeld-pysrc.html#plot_pred">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a name="pred_new_cases"></a><span class="summary-sig-name">pred_new_cases</span>(<span class="summary-sig-arg">obs</span>,
        <span class="summary-sig-arg">series</span>,
        <span class="summary-sig-arg">weeks</span>,
        <span class="summary-sig-arg">names</span>=<span class="summary-sig-default">[]</span>,
        <span class="summary-sig-arg">title</span>=<span class="summary-sig-default">'Total new cases per window: predicted vs observed'</span>,
        <span class="summary-sig-arg">ws</span>=<span class="summary-sig-default">7</span>)</span><br />
      Predicted total new cases in a window vs oserved.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="trunk.BIP.Bayes.PlotMeld-pysrc.html#pred_new_cases">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a name="plot_series2"></a><span class="summary-sig-name">plot_series2</span>(<span class="summary-sig-arg">tim</span>,
        <span class="summary-sig-arg">obs</span>,
        <span class="summary-sig-arg">series</span>,
        <span class="summary-sig-arg">names</span>=<span class="summary-sig-default">[]</span>,
        <span class="summary-sig-arg">title</span>=<span class="summary-sig-default">'Simulated vs Observed series'</span>,
        <span class="summary-sig-arg">wl</span>=<span class="summary-sig-default">7</span>,
        <span class="summary-sig-arg">lag</span>=<span class="summary-sig-default">False</span>)</span></td>
          <td align="right" valign="top">
            <span class="codelink"><a href="trunk.BIP.Bayes.PlotMeld-pysrc.html#plot_series2">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a name="plot_par_series"></a><span class="summary-sig-name">plot_par_series</span>(<span class="summary-sig-arg">tim</span>,
        <span class="summary-sig-arg">ptlist</span>)</span></td>
          <td align="right" valign="top">
            <span class="codelink"><a href="trunk.BIP.Bayes.PlotMeld-pysrc.html#plot_par_series">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a name="plot_par_violin"></a><span class="summary-sig-name">plot_par_violin</span>(<span class="summary-sig-arg">tim</span>,
        <span class="summary-sig-arg">ptlist</span>,
        <span class="summary-sig-arg">priors</span>=<span class="summary-sig-default">{}</span>,
        <span class="summary-sig-arg">bp</span>=<span class="summary-sig-default">True</span>)</span></td>
          <td align="right" valign="top">
            <span class="codelink"><a href="trunk.BIP.Bayes.PlotMeld-pysrc.html#plot_par_violin">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="trunk.BIP.Bayes.PlotMeld-module.html#violin_plot" class="summary-sig-name">violin_plot</a>(<span class="summary-sig-arg">ax</span>,
        <span class="summary-sig-arg">data</span>,
        <span class="summary-sig-arg">positions</span>,
        <span class="summary-sig-arg">bp</span>=<span class="summary-sig-default">False</span>,
        <span class="summary-sig-arg">prior</span>=<span class="summary-sig-default">False</span>)</span><br />
      Create violin plots on an axis</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="trunk.BIP.Bayes.PlotMeld-pysrc.html#violin_plot">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a name="peakdet"></a><span class="summary-sig-name">peakdet</span>(<span class="summary-sig-arg">v</span>,
        <span class="summary-sig-arg">delta</span>,
        <span class="summary-sig-arg">x</span>=<span class="summary-sig-default">None</span>)</span><br />
      Converted from MATLAB script at <a class="rst-reference external" href="http://billauer.co.il/peakdet.html" target="_top">http://billauer.co.il/peakdet.html</a>
Currently returns two lists of tuples, but maybe arrays would be better
function [maxtab, mintab]=peakdet(v, delta, x)
%PEAKDET Detect peaks in a vector
% [MAXTAB, MINTAB] = PEAKDET(V, DELTA) finds the local
% maxima and minima (&quot;peaks&quot;) in the vector V.
% MAXTAB and MINTAB consists of two columns. Column 1
% contains indices in V, and column 2 the found values.
%
% With [MAXTAB, MINTAB] = PEAKDET(V, DELTA, X) the indices
% in MAXTAB and MINTAB are replaced with the corresponding
% X-values.
%
% A point is considered a maximum peak if it has the maximal
% value, and was preceded (to the left) by a value lower by
% DELTA.
% Eli Billauer, 3.4.05 (Explicitly not copyrighted).
% This function is released to the public domain; Any use is allowed.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="trunk.BIP.Bayes.PlotMeld-pysrc.html#peakdet">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
</table>
<!-- ==================== FUNCTION DETAILS ==================== -->
<a name="section-FunctionDetails"></a>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td colspan="2" class="table-header">
    <table border="0" cellpadding="0" cellspacing="0" width="100%">
      <tr valign="top">
        <td align="left"><span class="table-header">Function Details</span></td>
        <td align="right" valign="top"
         ><span class="options">[<a href="#section-FunctionDetails"
         class="privatelink" onclick="toggle_private();"
         >hide private</a>]</span></td>
      </tr>
    </table>
  </td>
</tr>
</table>
<a name="violin_plot"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">violin_plot</span>(<span class="sig-arg">ax</span>,
        <span class="sig-arg">data</span>,
        <span class="sig-arg">positions</span>,
        <span class="sig-arg">bp</span>=<span class="sig-default">False</span>,
        <span class="sig-arg">prior</span>=<span class="sig-default">False</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="trunk.BIP.Bayes.PlotMeld-pysrc.html#violin_plot">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  Create violin plots on an axis
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>ax</code></strong> - : A subplot object</li>
        <li><strong class="pname"><code>data</code></strong> - : A list of data sets to plot</li>
        <li><strong class="pname"><code>positions</code></strong> - : x values to position the violins. Can be datetime.date objects.</li>
        <li><strong class="pname"><code>bp</code></strong> - : Whether to plot the boxplot on top.</li>
        <li><strong class="pname"><code>prior</code></strong> - : whether the first element of data is a Prior distribution.</li>
    </ul></dd>
  </dl>
</td></tr></table>
</div>
<br />
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
       bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="middle">
  <!-- Home link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="trunk.BIP-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Tree link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Project homepage -->
      <th class="navbar" align="right" width="100%">
        <table border="0" cellpadding="0" cellspacing="0">
          <tr><th class="navbar" align="center"
            ><a class="navbar" target="_top" href="http://code.google.com/p/bayesian-inference">Project Homepage</a></th>
          </tr></table></th>
  </tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" width="100%%">
  <tr>
    <td align="left" class="footer">
    Generated by Epydoc 3.0.1 on Wed Jan 26 15:29:58 2011
    </td>
    <td align="right" class="footer">
      <a target="mainFrame" href="http://epydoc.sourceforge.net"
        >http://epydoc.sourceforge.net</a>
    </td>
  </tr>
</table>

<script type="text/javascript">
  <!--
  // Private objects are initially displayed (because if
  // javascript is turned off then we want them to be
  // visible); but by default, we want to hide them.  So hide
  // them unless we have a cookie that says to show them.
  checkCookie();
  // -->
</script>
</body>
</html>
